package com.eop.entity;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 预案
 * 
 * @author ld
 * 
 */
@Entity
@Table(name = "eop_Schnario")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@NamedQueries( {
		@NamedQuery(name = "sr.getSchnarioByName", query = "from Schnario as sr where sr.srName like ? and sr.effect=true and sr.delFlag=false order by createDate desc"),
		@NamedQuery(name = "sr.getAllEffectSchnario", query = "from Schnario as sr where sr.effect=true and sr.delFlag=false order by createDate desc") })
public class Schnario {
	@Id
	private String id;
	/**
	 * 编码
	 */
	private String srCode;
	/**
	 * 名称
	 */
	private String srName;
	/**
	 * 类型（总体预案/专项预案/现场处置预案）
	 */
	private String srType;

	/**
	 * 适用范围大类
	 */
	private String srRangeBigType;
	/**
	 * 适用范围细类
	 */
	private String srRangeThinType;
	/**
	 * /** 关键字
	 */
	private String srKeyWord;

	/**
	 * 创建者
	 */
	private String createUser;
	/**
	 * 创建时间
	 */
	private Date createDate;

	/**
	 * 是否有效
	 */
	private boolean effect;
	/**
	 * 最新的系统版本号
	 */
	private String srVersion;
	/**
	 * 版本号
	 */
	private String version;
	/**
	 * 上一个版本的预案
	 */
	private String srLastSchnario;

	/**
	 * 预案状态
	 */
	private boolean publishState;
	/**
	 * 发布部门
	 */
	private String publishDep;
	/**
	 * 发布时间
	 */
	private Date publishDate;
	/**
	 * 摘要
	 */
	@Basic(fetch = FetchType.LAZY)
	@Column(columnDefinition = "text")
	private String model;
	/**
	 * 备注
	 */
	@Basic(fetch = FetchType.LAZY)
	@Column(columnDefinition = "text")
	private String remark;
	/**
	 * 文本
	 * 
	 * 此处做了修改，可以保存超大型的文本数据
	 */
	@Lob
	@Basic(fetch = FetchType.LAZY)
	//@Column(columnDefinition = "VARBINARY")
	private byte[] content;

	/**
	 * 标志是否删除
	 */
	private boolean delFlag;

	/*
	 * 9废止时间
	 */
	private Date scrapTime;

	public Schnario() {
		// this.id = IdUtils.getUUID();
	}

	public String getSrCode() {
		return srCode;
	}

	public void setSrCode(String srCode) {
		this.srCode = srCode;
	}

	public String getSrName() {
		return srName;
	}

	public void setSrName(String srName) {
		this.srName = srName;
	}

	public String getSrType() {
		return srType;
	}

	public void setSrType(String srType) {
		this.srType = srType;
	}

	public String getSrVersion() {
		return srVersion;
	}

	public void setSrVersion(String srVersion) {
		this.srVersion = srVersion;
	}

	public String getSrRangeBigType() {
		return srRangeBigType;
	}

	public void setSrRangeBigType(String srRangeBigType) {
		this.srRangeBigType = srRangeBigType;
	}

	public String getSrRangeThinType() {
		return srRangeThinType;
	}

	public void setSrRangeThinType(String srRangeThinType) {
		this.srRangeThinType = srRangeThinType;
	}

	public String getSrKeyWord() {
		return srKeyWord;
	}

	public void setSrKeyWord(String srKeyWord) {
		this.srKeyWord = srKeyWord;
	}

	public String getPublishDep() {
		return publishDep;
	}

	public void setPublishDep(String publishDep) {
		this.publishDep = publishDep;
	}

	public Date getPublishDate() {
		return publishDate;
	}

	public void setPublishDate(Date publishDate) {
		this.publishDate = publishDate;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public boolean isEffect() {
		return effect;
	}

	public void setEffect(boolean effect) {
		this.effect = effect;
	}

	public boolean isPublishState() {
		return publishState;
	}

	public void setPublishState(boolean publishState) {
		this.publishState = publishState;
	}

	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getSrLastSchnario() {
		return srLastSchnario;
	}

	public void setSrLastSchnario(String srLastSchnario) {
		this.srLastSchnario = srLastSchnario;
	}

	public boolean isDelFlag() {
		return delFlag;
	}

	public void setDelFlag(boolean delFlag) {
		this.delFlag = delFlag;
	}

	public Date getScrapTime() {
		return scrapTime;
	}

	public void setScrapTime(Date scrapTime) {
		this.scrapTime = scrapTime;
	}

	public byte[] getContent() {
		return content;
	}

	public void setContent(byte[] content) {
		this.content = content;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}
}
